/*
 * @Description:
 * @Version: 2.0
 * @Autor: snzo.chen
 * @Date: 2023-11-20 14:15:52
 * @LastEditors: snzo.chen
 * @LastEditTime: 2023-11-30 16:35:57
 */
import { request } from '@/utils/request';

/**
 * 查询所有票菜单
 * @param params
 * @returns
 */
export function selectAllMenuItem(params: API.PageParams) {
  return request<API.SeachResult>(
    {
      url: '/ticketMenuItem/selectAll',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 按条件查询
 * @param data
 * @returns
 */
export function selectByExample(data: API.TicketMenuItem, params: API.PageParams) {
  return request<API.SeachResult>(
    {
      url: '/ticketMenuItem/selectByExample',
      method: 'post',
      data,
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

export function insertTicketMenuItem(data: API.TicketMenuItem) {
  return request<API.BaseResult>(
    {
      url: '/ticketMenuItem/insertTicketMenuItem',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * 根据ID 查询票菜单详情
 * @param params
 * @returns
 */
export function selectMenuItemById(params: API.TicketMenuItem) {
  return request<API.TicketMenuItem>(
    {
      url: '/ticketMenuItem/selectById',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 更新票带单
 * @param data
 * @returns
 */
export function updateTicketMenuItem(data: API.TicketMenuItem) {
  return request<API.BaseResult>(
    {
      url: '/ticketMenuItem/updateTicketMenuItem',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * 根据ID删除票菜单
 * @param data
 * @returns
 */
export function deleteTicketMenuItem(data: API.TicketMenuItem) {
  return request<API.BaseResult>(
    {
      url: '/ticketMenuItem/deleteTicketMenuItem',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}
